package com.xkcoding.helloworld.strategy.enumWay;

import com.xkcoding.helloworld.strategy.DiscountContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;

@Service
public class TestServiceImpl {

    @Autowired
    private DiscountContext discountContext;

    public String test(DiscountEnum discountEnum, BigDecimal price) {
        return discountContext.execute(discountEnum.getDiscountImplName(), price);
    }

}

